package com.lock.lock_common.api.region;

import com.lock.lock_common.pojo.CityData;
import com.lock.lock_common.pojo.Region;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;

import java.util.List;

public interface RegionApi {
    /**
     * 查询出所有省份
     * @return
     */
    @RequestMapping("/selectProvince")
    List<Region> selectProvince();

    /**
     * 根据省级id查询该省下的所有市级
     * @param regionParentId
     * @return
     */
    @RequestMapping("/selectCity")
    List<Region> selectCity(@RequestParam Integer regionParentId);

    /**
     * 根据市级id查询该市级下的所有县级
     * @param regionParentId
     * @return
     */
    @RequestMapping("/selectRegion")
    List<Region> selectRegion(@RequestParam Integer regionParentId);

    /**
     * 根据regionId查询省市县
     * @param regionId
     * @return
     */
    @RequestMapping("selectRegionByRegionId")
    Region selectRegionByRegionId(@RequestParam Integer regionId);

    /**
     * 根据regionId查询出全部的省市区，并用字符串拼接起来
     * @param regionId
     * @return
     */
    @RequestMapping("/getAllRegion")
    String getAllRegion(@RequestParam  Integer regionId);

    /**
     * 根据regionId查询出全部的省市区，字符串不拼接
     * @param regionId
     * @return
     */
    @RequestMapping("/getAllRegion2")
    String getAllRegion2(@RequestParam  Integer regionId);

    /*遍历json树*/
    @RequestMapping("/getCityData")
    List<CityData> getCityData();
}
